package com.gcloud.login;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.StrictMode;
import android.view.View;
import android.widget.Button;

import com.gcloud.librerias.UserFunctions;
import com.example.gcode.*;  
import com.example.gcode.R.drawable;
import com.gcloud.dashboard.*;

public class LoginValidator extends Activity {
	UserFunctions userFunctions;

	@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        
//        if (android.os.Build.VERSION.SDK_INT > 9) {
//            StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
//            StrictMode.setThreadPolicy(policy);
//        }
//        UserFunctions a = new UserFunctions();
//
//        /**
//         * Dashboard Screen for the application
//         * */        
//        // Check login status in database
//        userFunctions = new UserFunctions();
//        if(userFunctions.isUserLoggedIn(getApplicationContext())){        	
        	Intent DashboardDes = new Intent(getApplicationContext(), DashboardDesign.class);
        	DashboardDes.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        	startActivity(DashboardDes);
        	finish();       	
//        }else{
//        	// user is not logged in show login screen
//        	Intent login = new Intent(getApplicationContext(), Login.class);
//        	login.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
//        	startActivity(login);
//        	// Closing dashboard screen
//        	finish();
//        }
        
        
        
        
    }
}